<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>css进阶背景</title>
		<style>
			body{
				background-repeat: no-repeat;
				background-image: url(img/1.jpg);
				/* 背景随着页面滚动:scroll,默认值
				页面滚动而背景固定:fixed */
				/* background-attachment: fixed; */
				/* background-position: right bottom /20%; */
				/* 复合写法: */
				/* background: color image repeat attachment position/size; */
				background: gainsboro url(img/1.jpg) no-repeat fixed center/100% 100%;
			}
			.box{
				width: 1200px;
				height: 1200px;
				border: 1px solid greenyellow;
				/* transparent:透明色 */
				background-color: #ffaa33;
				background-image: url(img/C.jpg);
				/* 背景图片重复显示:repeat
				   背景图片不重复显示：no-repeat
				 */
				background-repeat: no-repeat;
				font-size: 36px;
			}
		</style>
	</head>
	<body>
		<div class="box">
			这是我的家乡，神秘又美丽
		</div>
	</body>
</html>
